package edu.hubu.view;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/AddView")
public class AddView extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse res)
			throws ServletException, IOException {

		res.setContentType("text/html;charset=utf-8");
		PrintWriter out = res.getWriter();
		
		out.println("<html><head><title>login</title>");
		out.println("<meta http-equiv='keywords' content='keyword1,keyword2,keyword3'>");
		out.println("<meta http-equiv='description' content='this is my page'>");
		out.println("<meta http-equiv='content-type' content='text/html; charset=UTF-8'>");
		out.println("<!--<link rel='stylesheet' type='text/css' href='./styles.css'>-->");
		out.println("</head><body>");
		out.println("<img src='img/header.jpg' width='150px' height='50px' /><hr/>");
		out.println("<h1>添加用户</h1>");
		out.println("<form action='/UserManage/UserController?type=addUser' method='post'>");
		out.println("<label for='name' >用户名：</label><br/>");
		out.println("<input type='text' name='name' id='name'/><br/>");
		out.println("<label for='pwd' >密&nbsp;&nbsp;码：</label><br/>");
		out.println("<input type='password' name='pwd' id='pwd'/><br/>");
		out.println("<label for='pwd2' >密码确认：</label><br/>");
		out.println("<input type='password' name='pwd2' id='pwd2'/><br/>");
		out.println("<label for='nickName' >昵&nbsp;&nbsp;称：</label><br/>");
		out.println("<input type='text' name='nickName' id='nickName'/><br/>");
		out.println("<label>性&nbsp;&nbsp;别：</label><br/>");
		out.println("<input type='radio' name='gender' value='1' id='male'/>");
		out.println("<label for='male' >男</label>");
		out.println("<input type='radio' name='gender' value='0' id='female'/>");
		out.println("<label for='female' >女</label><br/>");
		out.println("<label for='birthday' >生&nbsp;&nbsp;日：</label><br/>");
		out.println("<input type='text' name='birthday' id='birthday'/><br/>");
		out.println("<label>爱&nbsp;&nbsp;好：</label><br/>");
		out.println("<input type='checkbox' name='hobby' value='吃饭' id='eat'/>");
		out.println("<label for='eat' >吃饭</label>");
		out.println("<input type='checkbox' name='hobby' value='睡觉' id='sleep'/>");
		out.println("<label for='sleep' >睡觉</label>");
		out.println("<input type='checkbox' name='hobby' value='写程序' id='work'/>");
		out.println("<label for='work' >写程序</label><br/>");
		out.println("<label for='tel' >电&nbsp;&nbsp;话：</label><br/>");
		out.println("<input type='text' name='tel' id='tel'/><br/>");
		out.println("<label for='email' >邮&nbsp;&nbsp;箱：</label><br/>");
		out.println("<input type='text' name='email' id='email'/><br/>");
		out.println("<label for='grade' >等&nbsp;&nbsp;级：</label><br/>");
		out.println("<input type='text' name='grade' id='grade'/><br/>");
		out.println("<label>描&nbsp;&nbsp;述：</label><br/>");
		out.println("<textarea name='description'></textarea><br/>");
		out.println("<input type='submit' value='添加' />");
		out.println("<input type='reset' value='重置' />");
		out.println("</form>");
		out.println("<hr/><img src='img/footer.jpg' width='150px' height='50px' />");
		out.println("</body></html>");

	}

	public void doPost(HttpServletRequest req, HttpServletResponse res)
			throws ServletException, IOException {

		this.doGet(req, res);

	}

}
